<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标记 - 组件演示</title>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../components/mark/mark.css">
</head>
<body>
    <div class="container">
        <header class="header">
            <h1>🚀 openHarmony_Cordova_NutpiDesign</h1>
            <p class="subtitle">组件演示 - 标记</p>
        </header>

        <nav class="demo-nav">
            <a href="../index.html" class="nav-back">← 返回首页</a>
        </nav>

        <main class="main-content">
            <section class="demo-section">
                <h2>📌 标记演示</h2>
                
                <div class="demo-container">
                    <div class="demo-item">
                        <h3>基础标记</h3>
                        <div id="basicMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>成功标记</h3>
                        <div id="successMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>错误标记</h3>
                        <div id="errorMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>警告标记</h3>
                        <div id="warningMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>信息标记</h3>
                        <div id="infoMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>可关闭标记</h3>
                        <div id="closableMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>自定义颜色</h3>
                        <div id="customColorMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>小尺寸</h3>
                        <div id="smallMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>中尺寸</h3>
                        <div id="mediumMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>大尺寸</h3>
                        <div id="largeMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>可关闭成功</h3>
                        <div id="closableSuccessMark"></div>
                    </div>

                    <div class="demo-item">
                        <h3>可关闭错误</h3>
                        <div id="closableErrorMark"></div>
                    </div>
                </div>
            </section>

            <section class="demo-section">
                <h2>使用代码</h2>
                <pre><code>// 1. 引入文件
&lt;link rel="stylesheet" href="components/mark/mark.css"&gt;
&lt;script src="components/mark/mark.js"&lt;/script&gt;

// 2. 创建容器
&lt;div id="markContainer"&lt;/div&gt;

// 3. 初始化标记组件
const mark = new Mark({
    container: '#markContainer',
    content: '新功能',
    type: 'success',
    size: 'medium',
    closable: true,
    onClose: () => {
        console.log('标记已关闭');
    }
});

// 4. 设置内容
mark.setContent('更新内容');

// 5. 设置类型
mark.setType('error');

// 6. 设置颜色
mark.setColor('#ff6b6b');</code></pre>
            </section>
        </main>

        <footer class="footer">
            <p>&copy; 2025 OpenHarmony 三方库适配中心 | MIT License</p>
        </footer>
    </div>

    <script src="../components/mark/mark.js"></script>
    <script>
        // 基础标记
        new Mark({
            container: '#basicMark',
            content: '新功能'
        });

        // 成功标记
        new Mark({
            container: '#successMark',
            content: '成功',
            type: 'success'
        });

        // 错误标记
        new Mark({
            container: '#errorMark',
            content: '错误',
            type: 'error'
        });

        // 警告标记
        new Mark({
            container: '#warningMark',
            content: '警告',
            type: 'warning'
        });

        // 信息标记
        new Mark({
            container: '#infoMark',
            content: '信息',
            type: 'info'
        });

        // 可关闭标记
        new Mark({
            container: '#closableMark',
            content: '可关闭',
            closable: true,
            onClose: () => {
                console.log('标记已关闭');
            }
        });

        // 自定义颜色
        new Mark({
            container: '#customColorMark',
            content: '自定义',
            color: '#ff6b6b'
        });

        // 小尺寸
        new Mark({
            container: '#smallMark',
            content: '小',
            size: 'small'
        });

        // 中尺寸
        new Mark({
            container: '#mediumMark',
            content: '中',
            size: 'medium'
        });

        // 大尺寸
        new Mark({
            container: '#largeMark',
            content: '大',
            size: 'large'
        });

        // 可关闭成功
        new Mark({
            container: '#closableSuccessMark',
            content: '成功',
            type: 'success',
            closable: true
        });

        // 可关闭错误
        new Mark({
            container: '#closableErrorMark',
            content: '错误',
            type: 'error',
            closable: true
        });
    </script>

    <style>
        .demo-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .demo-item {
            background: var(--bg-light);
            padding: 16px;
            border-radius: 8px;
            overflow: visible;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100px;
        }

        .demo-item h3 {
            margin-top: 0;
            margin-bottom: 16px;
            font-size: 14px;
            color: var(--text-primary);
            width: 100%;
            text-align: center;
        }

        @media (max-width: 768px) {
            .demo-container {
                grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            }
        }
    </style>
</body>
</html>
